package com.winway.framework.sap.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 连接sap的配置实体
 *
 * @author wrh
 * @date 2021-09-16
 */
@Configuration
public class SapConn {
    /**
     * SAP服务器
     */
    public static String JCO_ASHOST;
    /**
     * SAP系统编号
     */
    public static String JCO_SYSNR;
    /**
     * SAP集团
     */
    public static String JCO_CLIENT;
    /**
     * SAP用户名
     */
    public static String JCO_USER;
    /**
     * SAP密码
     */
    public static String JCO_PASSWD;
    /**
     * SAP登录语言
     */
    public static String JCO_LANG;
    /**
     * 最大连接数
     */
    public static String JCO_POOL_CAPACITY;
    /**
     * 最大连接线程
     */
    public static String JCO_PEAK_LIMIT;
    /**
     * SAP ROUTER
     */
    public static String JCO_SAPROUTER;

    /**
     * SAP的连接地址
     */
    public static String SAP_URL;

    /**
     * SAP凭证id
     */
    public static String POLICY_WSU_ID;

    @Value("${sap.asHost}")
    public void setAsHost(String asHost) {
        JCO_ASHOST = asHost;
    }

    @Value("${sap.sysNr}")
    public void setSysNr(String sysNr) {
        JCO_SYSNR = sysNr;
    }

    @Value("${sap.client}")
    public void setClient(String client) {
        JCO_CLIENT = client;
    }

    @Value("${sap.user}")
    public void setUser(String user) {
        JCO_USER = user;
    }

    @Value("${sap.passWord}")
    public void setPassWord(String passWord) {
        JCO_PASSWD = passWord;
    }

    @Value("${sap.language}")
    public void setLanguage(String language) {
        JCO_LANG = language;
    }

    @Value("${sap.poolCapacity}")
    public void setPoolCapacity(String poolCapacity) {
        JCO_POOL_CAPACITY = poolCapacity;
    }

    @Value("${sap.peakLimit}")
    public void setPeakLimit(String peakLimit) {
        JCO_PEAK_LIMIT = peakLimit;
    }

    @Value("${sap.sapRouter}")
    public void setSapRouter(String sapRouter) {
        JCO_SAPROUTER = sapRouter;
    }

    @Value("${sap.url}")
    public void setSapUrl(String sapUrl) {
        SAP_URL = sapUrl;
    }

    @Value("${sap.policyWsuId}")
    public void setPolicyWsuId(String policyWsuId) {
        POLICY_WSU_ID = policyWsuId;
    }
}
